home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 16 / 64er_Magazin_Sonderheft_16_19xx_Markt__Technik_de_Side_A.d64 / ls 11.doc < prev    next >
Text File  |  2022-10-26  |  2KB  |  100 lines

  1.     Assemblerlisting zur Animation eines Sprites
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.     ,8000  a9 05     lda #05     ;Rahmenfarbe
  10.  
  11.     ,8002  8d 20 d0  sta d020
  12.  
  13.     ,8005  a9 00     lda #00     ;Hintergrundfarbe
  14.  
  15.     ,8007  8d 21 d0  sta d021
  16.  
  17.     ,800a  a9 08     lda #08     ;Sprite-Farbe 1
  18.  
  19.     ,800c  8d 25 d0  sta d025
  20.  
  21.     ,800f  a9 0b     lda #0b     ;Sprite-Farbe 2
  22.  
  23.     ,8011  8d 26 d0  sta d026
  24.  
  25.     ,8014  a9 07     lda #07     ;Sprite-Farbe 3
  26.  
  27.     ,8016  8d 27 d0  sta d027
  28.  
  29.     ,8019  a9 01     lda #01     ;Multicolor
  30.  
  31.     ,801b  8d 1c d0  sta d01c
  32.  
  33.     ,801e  a9 80     lda #80     ;Spritezeiger Block 128
  34.  
  35.     ,8020  8d f8 07  sta 07f8
  36.  
  37.     ,8023  a9 a0     lda #a0     ;Y-Anfangsposition
  38.  
  39.     ,8025  8d 01 d0  sta d001
  40.  
  41.     ,8028  a9 00     lda #00     ;X-Anfangsposition
  42.  
  43.     ,802a  8d 00 d0  sta d000
  44.  
  45.     ,802d  8d 10 d0  sta d010    ;]berlaufregister l{$7c}schen
  46.  
  47.     ,8030  a9 01     lda #01     ;Sprite 0 an
  48.  
  49.     ,8032  8d 15 d0  sta d015
  50.  
  51.     ,8035  20 59 80  jsr 8059    ;Unterprogramm Animation
  52.  
  53.     ,8038  ee 00 d0  inc d000    ;X-Position + 2
  54.  
  55.     ,803b  ee 00 d0  inc d000
  56.  
  57.     ,803e  d0 f5     bne 8035
  58.  
  59.     ,8040  a9 01     lda #01     ;wenn X>255 ]berlaufbit setzen
  60.  
  61.     ,8042  8d 10 d0  sta d010
  62.  
  63.     ,8045  20 59 80  jsr 8059    ;Unterprogramm Animation
  64.  
  65.     ,8048  ee 00 d0  inc d000    ;X-Position + 2
  66.  
  67.     ,804b  ee 00 d0  inc d000
  68.  
  69.     ,804e  ad 00 d0  lda d000    ;Abfrage
  70.  
  71.     ,8051  c9 5a     cmp #5a     ;auf Ende (X>350)
  72.  
  73.     ,8053  30 f0     bmi 8045
  74.  
  75.     ,8055  18        clc 
  76.  
  77.     ,8056  4c 00 80  jmp 8000    ;Neustart
  78.  
  79.     -----------------------------------
  80.  
  81.     ,8059                        ;Unterprogramm Animation
  82.  
  83.     ,8059  ae f8 07  ldx 07f8
  84.  
  85.     ,805c  e8        inx         ;n{$7b}chstes Bild
  86.  
  87.     ,805d  e0 88     cpx #88
  88.  
  89.     ,805f  d0 02     bne 8063
  90.  
  91.     ,8061  a2 80     ldx #80
  92.  
  93.     ,8063  8e f8 07  stx 07f8    ;in Spritezeiger
  94.  
  95.     ,8066  20 6a 80  jsr 806a    ;Unterprogramm Warteschleife
  96.  
  97.     ,8069  60        rts         ;Ende Animation
  98.  
  99.     -----------------------------------
  100.  
  101.     ,806a                        ;Unterprogramm Warteschleife
  102.  
  103.     ,806a  a2 00     ldx #00
  104.  
  105.     ,806c  a0 10     ldy #10     ;Schleifendauer
  106.  
  107.     ,806e  ca        dex 
  108.  
  109.     ,806f  d0 fd     bne 806e
  110.  
  111.     ,8071  ca        dex 
  112.  
  113.     ,8072  d0 fa     bne 806e
  114.  
  115.     ,8074  60        rts         ;Ende Warteschleife
  116.  
  117.      
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.      
  159.  
  160.